package io.gitee.chearnee.fw.datasecurity.core.handler.desensitization;


import io.gitee.chearnee.fw.datasecurity.core.annotation.desensitization.SDGeneralField;

/**
 * @author cn
 * @version 1.0
 * @description
 * @date 11/9/2022 5:13 PM
 */
public class SDGeneralRuleHandler implements SDRuleHandler<SDGeneralField> {

    public SDGeneralRuleHandler() {
        //init
    }


    @Override
    public Class<SDGeneralField> getAnnotationType() {
        return SDGeneralField.class;
    }

    @Override
    public String masking(SDGeneralField t, String object) {
        return processing(t, object);
    }

    private String processing(SDGeneralField t, String object) {

        return baseMasking(t.firstShow(), t.lastShow(), t.mask(), object);
    }
}
